03a6a675fe39768ccc73ca0fdafb4408e4b0b64d,src/main/java/com/pusher/client/util/HttpAuthorizer.java,HttpAuthorizer,authorize,#String#String#,52

Before Change



		try {
			String urlParameters = "channel_name="
					+ URLEncoder.encode(channelName, "UTF-8") + "&socket_id="
					+ URLEncoder.encode(socketId, "UTF-8");

			HttpURLConnection connection = (HttpURLConnection) endPoint

After Change


			throws AuthorizationFailureException {

		try {
			StringBuffer urlParameters = new StringBuffer(); 
			urlParameters.append("channel_name=").append(URLEncoder.encode(channelName, ENCODING_CHARACTER_SET));
			urlParameters.append("&socket_id=").append(URLEncoder.encode(socketId, ENCODING_CHARACTER_SET));
			

			// Adding extra parameters supplied to be added to query string.
			for(String parameterName : mQueryStringParameters.keySet()){
				urlParameters.append("&").append(parameterName).append("=");
				urlParameters.append(URLEncoder.encode(mQueryStringParameters.get(parameterName), ENCODING_CHARACTER_SET));
			}
			
			HttpURLConnection connection = null;
			if( this.isSSL() ) {
				connection = (HttpsURLConnection) endPoint.openConnection();
			}
			else {
				connection = (HttpURLConnection) endPoint.openConnection();
			}
			connection.setDoOutput(true);
			connection.setDoInput(true);
			connection.setInstanceFollowRedirects(false);
			connection.setRequestMethod("POST");
			connection.setRequestProperty("Content-Type",
					"application/x-www-form-urlencoded");
			connection.setRequestProperty("charset", "utf-8");
			connection.setRequestProperty("Content-Length",
					"" + Integer.toString(urlParameters.toString().getBytes().length));

			// Add in the user defined headers
			for (String headerName : mHeaders.keySet()) {